import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpModule } from '@angular/http';
import { LocationStrategy, HashLocationStrategy, registerLocaleData } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { HttpClientModule } from '@angular/common/http';
import { AppRoutingModule } from './app-routing.module';

// service
import { UtilService } from './my-service/util.service';
import { appService } from './my-service/app.service';
import { classService } from './my-service/class.service';
// 模块组件
import { homeComponent } from './home/home.component';
import { otherComponent } from './other/other.component';
import { listComponent } from './home/list/list.component';
import { canvaslistComponent } from './canvaslist/canvaslist.component';

import { canvasComponent } from './canvas/canvas.component';
import { canvasaddComponent } from './canvas/canvasadd/canvasadd.component';
import { canvasmsgComponent } from './canvas/canvasmsg/canvasmsg.component';
import { canvasCodeComponent } from './canvas/canvasCode/canvasCode.component';
import { chartsComponent } from './canvas/charts/charts.component';
import { dataComponent } from './canvas/data/data.component'; 
import { notecanvasComponent } from './canvas/notecanvas/notecanvas.component';
import { questioncanvasComponent } from './canvas/questioncanvas/questioncanvas.component';
import { canvasDustbinComponent } from './canvas/canvasDustbin/canvasDustbin.component';
import { trainMsgComponent } from './canvas/trainMsg/trainMsg.component';
import { addboxComponent } from './canvas/addbox/addbox.component';
// 公共组件
import { AppComponent } from './app.component';
import { NavComponent } from './nav/nav.component';
import { breadcrumbComponent } from './my-public/breadcrumb/breadcrumb.component';
import { LoadingComponent } from './my-public/loading/loading.component';
import { maskComponent } from './my-public/mask/mask.component';
import { closeComponent } from './my-public/close.component';
import { tabsetComponent } from './my-public/tabset.component';

// UI
import { NgZorroAntdModule, NZ_MESSAGE_CONFIG } from 'ng-zorro-antd';
//directive
import { ZeditorDirective } from './my-directive/zeditor.directive';
import { clickstopDirective } from './my-directive/clickstop.directive';
//pipe
import { ToTimePipe } from './my-pipe/to-time.pipe';
//guard
import { LoginGuard } from './my-guard/login.guard';

@NgModule({
  declarations: [
    AppComponent, 
    NavComponent,
    otherComponent, 
    breadcrumbComponent, 
    LoadingComponent, 
    maskComponent, 
    ZeditorDirective, 
    clickstopDirective,
    closeComponent,
    homeComponent,
    listComponent,
    ToTimePipe,
    tabsetComponent,
    canvasComponent,
    canvasaddComponent,
    canvasmsgComponent,
    canvasCodeComponent,
    chartsComponent,
    dataComponent,
    notecanvasComponent,
    questioncanvasComponent,
    canvasDustbinComponent,
    canvaslistComponent,
    addboxComponent,
    trainMsgComponent
  ],
  entryComponents: [],
  imports: [
    AppRoutingModule,
    HttpClientModule,
    BrowserModule,
    FormsModule,
    BrowserAnimationsModule,
    NgZorroAntdModule,
    HttpModule
  ],
  providers: [
    UtilService,
    LoginGuard,
    appService,
    classService,
    // { provide: LocationStrategy, useClass: HashLocationStrategy },
    { provide: NZ_MESSAGE_CONFIG, useValue: { nzDuration: 2000, nzMaxStack: 1 } }//zorro全局提示配置
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }